@extends('admin.app')

@section('breadcrumb')
  <div class="bg-light lter b-b wrapper-md">
    <ol class="breadcrumb bg-light lter m-n no-padder">
      <li><a href="{{admin_action('HomeController@index')}}">主页</a></li>
      <li><a href="{{admin_action('Web\ProfitsController@index')}}">分润规则</a></li>
      <li class="active">分润规则信息</li>
    </ol>
  </div>
@endsection

@section('content')
  <div class="panel panel-default">
    <div class="panel-heading font-bold">
      信息模板详细
    </div>
    <div class="panel-body">
      <form class="form-horizontal">
        <div class="form-group">
          <label class="col-lg-2 control-label">名称：</label>
          <div class="col-lg-10">
            <p class="form-control-static">  {{$profit->name}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        @foreach ($stages as $stage)
          <div class="form-group">
            <label class="col-lg-2 control-label">{{$stage->name}}*</label>
            <div class="col-sm-12">
              <div class="form-group">
                <label class="col-lg-2 control-label"></label>
                <div  class="col-sm-7">
                  @foreach ($profit_roles as $profit_role)
                    @if($stage->code==$profit_role->stage)
                      <div class="form-group">
                        <label  class="col-lg-2 text-right">{{$profit_role->role()->name}} </label>
                        <div class="col-sm-3">
                          {{$profit_role->scale}} %
                        </div>
                      </div>
                    @endif
                  @endforeach
                </div>
              </div>
            </div>
          </div>
        @endforeach
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">分润方式：</label>
          <div class="col-lg-10">
            <p class="form-control-static">  {{$profit->mode()->name}} </p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">是否禁用：</label>
          <div class="col-lg-10">
            <p class="form-control-static">  {{$profit->state?'否':'是'}} </p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-lg-4 col-lg-offset-2">
            <a href="{{ admin_action('Web\ProfitsController@index') }}" class="btn btn-default">返&nbsp;回</a>
          </div>
        </div>
      </form>
    </div>
  </div>
@endsection